package com.srcptit.java.training.kienbd.bt1;
import java.util.Scanner;
public class Muc1_Bai3_PTTSNT {
	static int n;
	static void nhap()
	{
            Scanner sc=new Scanner(System.in);
            System.out.print("Nhap so can phan tich : ");
            n=sc.nextInt();
            sc.close();
	}
	static int snt(int n)
	{
            if(n==1||n==0)  return 0;
            for(int i=2;i<=Math.sqrt(n);i++)
            {
		if(n%i==0)	return 0;
            }
            return 1;
	}
	static int pttsnt()
	{
            if(snt(n)==1) System.out.print(+n);
            else
             {
                int i=2;
        	if(n%i==0)
                  {
                    while(n%i==0) { System.out.print(i+" ");n=n/i; }
                    if(n==1)		return 0;
                  }
                    i=i+1;
                    while(n>1)
                    {
                      	if(snt(n)==1) {	System.out.print(+n);return 0; }
			while(n%i==0) { System.out.print(i+" ");n=n/i; }
			i++;
                    }
              }
            return 0;
	}
	public static void main(String args[]){
            nhap();
            pttsnt();
	}
}
